home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libwmf / gd.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-02-16  |  2.3 KB  |  87 lines

  1. /* libwmf (<libwmf/gd.h>): library for wmf conversion
  2.    Copyright (C) 2000 - various; see CREDITS, ChangeLog, and sources
  3.  
  4.    The libwmf Library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public License as
  6.    published by the Free Software Foundation; either version 2 of the
  7.    License, or (at your option) any later version.
  8.  
  9.    The libwmf Library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public
  15.    License along with the libwmf Library; see the file COPYING.  If not,
  16.    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.    Boston, MA 02111-1307, USA.  */
  18.  
  19.  
  20. #ifndef LIBWMF_GD_H
  21. #define LIBWMF_GD_H
  22.  
  23. #include <libwmf/types.h>
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. typedef enum _wmf_gd_subtype
  30. {    wmf_gd_png = 0,
  31.     wmf_gd_jpeg,
  32.     wmf_gd_image
  33. } wmf_gd_subtype;
  34.  
  35. typedef struct _wmf_gd_t wmf_gd_t;
  36.  
  37. struct _wmf_gd_t
  38. {    wmf_gd_subtype type;
  39.  
  40.     void* gd_data;
  41.  
  42.     FILE* file;
  43.  
  44.     char* memory;
  45.  
  46.     struct _wmf_gd_sink
  47.     {    void* context;
  48.         int (*function) (void* context,char* buffer,int length);
  49.     } sink;
  50.  
  51.     /* pointer to gdImage; null prior to wmf_play ()
  52.      */
  53.     void* gd_image;
  54.  
  55.     unsigned int width;
  56.     unsigned int height;
  57.  
  58.     wmfD_Rect bbox;
  59.  
  60.     unsigned long flags;
  61. };
  62.  
  63. #define WMF_GD_SUPPORTS_PNG  (1 <<  0) /* Set by wmf_api_create () if PNG  supported */
  64. #define WMF_GD_SUPPORTS_JPEG (1 <<  1) /* Set by wmf_api_create () if JPEG supported */
  65.  
  66. #define WMF_GD_OUTPUT_FILE   (1 << 16)
  67. #define WMF_GD_OUTPUT_MEMORY (1 << 17)
  68. #define WMF_GD_OWN_BUFFER    (1 << 18) /* To be used in conjuction with WMF_GD_OUTPUT_MEMORY */
  69.  
  70. #define WMF_GD_GetData(Z) ((wmf_gd_t*)((Z)->device_data))
  71.  
  72. extern void wmf_gd_function (wmfAPI*);
  73.  
  74. /**
  75.  * If using the wmf_gd_image option to write to a GD image, collected from
  76.  * the void* gd_image member of the device data struct above, the true-color
  77.  * pixels (stored in a contiguous array of height * width integers) of the
  78.  * image can be retrieved using wmf_gd_image_pixels()
  79.  */
  80. extern int * wmf_gd_image_pixels (void * gd_image);
  81.  
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85.  
  86. #endif /* ! LIBWMF_GD_H */
  87.